<!DOCTYPE html>
<html>

<head>
	<meta charset="utf-8" />
	<title>Tofita Web UI</title>
</head>

<body>
	<style type="text/css">
	* {
		font-family: sans-serif;
	}

	body {
		background-color: darkgray;
	}

	</style>
	<div id="log">Check Chrome Developer Tools Console</div>
	<script type="text/javascript">
	;
	(function() {
		console.log('[Welcome to the Tofita Web UI!]')

		var busy = false
		setInterval(function() {
			if (busy) return
			busy = true

			fetch('/buffer.json')
				.then((response) => {
					return response.json();
				})
				.catch((error) => {
					//console.error('Error:', error);
					busy = false
				})
				.then((data) => {
					// Dev Tools don't filter on single .log
					const lines = data? ('' + data).split('\n') : []
					for (const line of lines) if (line) console.log(line);
					busy = false
				})
				.catch((error) => {
					//console.error('Error:', error);
					busy = false
				})

		}, 111);

	})();

	</script>
</body>

</html>
